﻿<Window x:Class="Andora.BlogSamples.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="350" Width="525" 
        xmlns:userControls="clr-namespace:Andora.UserControlLibrary;assembly=Andora.UserControlLibrary"
        xmlns:converters="clr-namespace:Andora.BlogSamples.Converters">
    <!--
    /*
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
 * IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 
 * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 
 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 
 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 
 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-->
    <Window.Resources>
        <converters:NotConverter x:Key="negationConverter" />
    </Window.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="40" />
            <RowDefinition />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition />
            <ColumnDefinition />
        </Grid.ColumnDefinitions>

        <userControls:DateRangeSlider x:Name="dateRangeSlider1" 
                            LowerValue="02/01/2011 8:00 AM"
                            UpperValue="10/31/2011 8:30 PM"
                            Minimum="01/01/2011 12:00 AM"
                            Maximum="12/31/2011 11:59:59 PM"
                            Grid.ColumnSpan="2" Grid.Column="0"
                            Grid.Row="0" 
                            IsUpperSliderEnabled="{Binding ElementName=chkDisableUpperSlider, Path=IsChecked, Converter={StaticResource ResourceKey=negationConverter}, Mode=TwoWay}"
                            IsLowerSliderEnabled="{Binding ElementName=chkDisableLowerSlider, Path=IsChecked, Converter={StaticResource ResourceKey=negationConverter}, Mode=TwoWay}"
                            IsUpperValueLockedToMax="{Binding ElementName=chkLockUpperSliderToMax, Path=IsChecked, Mode=TwoWay}"
                            IsLowerValueLockedToMin="{Binding ElementName=chkLockLowerSliderToMin, Path=IsChecked, Mode=TwoWay}"
                            SmallChange="0:0:30:0.000"
                            LargeChange="0:1:0:0.000"/>

        <StackPanel Orientation="Vertical" Grid.Row="1" Grid.Column="0" 
                    VerticalAlignment="Top"
                    HorizontalAlignment="Left">
            <TextBlock Text="{Binding ElementName=dateRangeSlider1, Path=LowerValue, Mode=OneWay}" Height="23"  Margin="10"/>
            <CheckBox x:Name="chkDisableLowerSlider" Content="Diable Lower Slider" />
            <CheckBox x:Name="chkLockLowerSliderToMin" Content="Lock Lower Slider to Min" HorizontalAlignment="Left" />
        </StackPanel>
        <StackPanel Orientation="Vertical" Grid.Row="1" Grid.Column="1" 
                    VerticalAlignment="Top"
                    HorizontalAlignment="Right">
            <TextBlock Text="{Binding ElementName=dateRangeSlider1, Path=UpperValue, Mode=OneWay}" Height="23"  Margin="10"/>

            <CheckBox x:Name="chkDisableUpperSlider" Content="Diable Upper Slider" HorizontalAlignment="Left" />
            <CheckBox x:Name="chkLockUpperSliderToMax" Content="Lock Upper Slider to Max" HorizontalAlignment="Left" />

            <Button Content="Reset" Click="Button_Click_1" Margin="15" />
        </StackPanel>
    </Grid>
</Window>
